package com.lz.demo5;

/**
 * @ClassName Major
 * @Description 专业类
 * @Author 2214361854
 * @Date 2022/5/28 14:53
 * @Version 1.0
 */
//5.创建专业类,注意这个是一个父类,下属还有3个子类代表3个不同的具体专业
public class Major {
    //6.定义专业类的属性
    protected double totalScore;//总成绩
    protected double englishScore;//英文成绩
    protected double midScore;//期中成绩
    protected double finalScore;//期末成绩

    //7.提供本类的全参构造,注意总成绩需要计算得出,不在本构造方法里
    public Major(double englishScore, double midScore, double finalScore) {
        this.englishScore = englishScore;
        this.midScore = midScore;
        this.finalScore = finalScore;
    }

    //8.创建一个计算获取成绩的方法
    //由于这个方法一定会被子类重写,所以方法里没有具体计算成绩的业务
    public double getScore() {
        return totalScore;
    }

    public double getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(double totalScore) {
        this.totalScore = totalScore;
    }

    public double getEnglishScore() {
        return englishScore;
    }

    public void setEnglishScore(double englishScore) {
        this.englishScore = englishScore;
    }

    public double getMidScore() {
        return midScore;
    }

    public void setMidScore(double midScore) {
        this.midScore = midScore;
    }

    public double getFinalScore() {
        return finalScore;
    }

    public void setFinalScore(double finalScore) {
        this.finalScore = finalScore;
    }
}
